package com.bjpowernode.money.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */
public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000121641066";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCKnBtWLy7ryhvkBcUdW225NciD4t9NMyNzzow7f0zOPb6DjO1x14AyyC+PuMe9q1gN1IDtkwK8tvxL6jGgIWubxGBVNw9Sq3C4x01WHfK+Jhq9JN6vwuarQRrK2TikiXwjZ+rujuHooMHir1w9g9nSk5UUauP//ybSwETpksYYeqzRIFMRcAgmpjZKUYqPDrFhA6EZSmWhiZ8Ts/HEBXVLX1Fc3oTvO7iLz3B6ZCmT3KkyHtg8T9wXR4tNpT36Amy9cvvkkbZNdyWIQs/8XH9RaUKadAkZY6mRtzcXCPcTv8GC6/H6VgKLYzCE3ng1JJPmyhPkyW3jgy1iWDrVjqbxAgMBAAECggEAVWCytfN6Q2LKqzmioOKgQ2UNja9BPJwzSjH/zuYquR7vKrizyVuka6NDKJP49KuGIX6zq6LSHMvZvCkVSD1NuzTK4bJ4jcNsO2UIDfOEgfuWnMsJH9o9m18O0cPbT/4fqO9plmgMXu4mfyrk9j8w/LRLL7hnmFfh4g7sY7M0sf51pfqysr2+ddm/TqCu7rcsvgrYEyRRCip/1XyhHjy2uTccjaqUmT5FS1pb1WHB7OXLQdV5CJPHZ10mXnPcSMlzWyUqHIqlaVnWeltoN12w96r8WwLBZHs61phF/ywXGq6fV79w8XzBri85v5tnmpq653g3zICE0iITct2728OAwQKBgQDKp5x37wSTOgqB5lIGlmV0g3W/+nSanqYj053E6PnLheQKHp1rdmiw39pEbDiKlja6Bo0Wt96hF49wTpQ/nB/c5HYNYYN75SlmQGB7Dpv7S7eOJ5MFlNk2pkZob/Vdie0bwBtZ7IxrtBfRP27PiJXhaSEsV6cPcCAVv4cFi4MdLwKBgQCvGKtfdohd+FOHfUNpfg0CFVAMJ6+DfK08I2TfEDpOafj1bk3esthQxJ3Di+cVtxR7JUYYLp8x5dD6qAtyQ0Owl5bsrLpniOET4JRJpfpMfG+F8GYPI/dTqAwSloY3lIq+4mDs+bYwZFO+Wk47DVd26oN3zocD7QBudcIy/yq13wKBgCejn1xqOTffC30bIwI82r1ulVKm17YCwDaTxvFkLLAdkVxVXq9Nau7l6lil3m1lMnEypNhDwN07sYfjJuZGUIkxetHlOAW87lsczoJjeikuR0ob/YsC8XXaEj2NYK4aM3HRIsh1F4ZdpKb+RFt9uOttV9rHjlrbsLrwSqXQAyZrAoGAUMINEKun+8d0JzKkK/zCXSqdT+3h6sBPWkRs2uEuM0p3VCO68LMGSEJXDYDyZTaa0K2BZdfi/u2jdGibVuklSEayipikJOqh/TwAyPMvvaVK/rjBKcyJ32DLqKsaXno5gA8Da2lFGY68fThDisL9i1BgsJpl9W6TW18e4cyE03sCgYEAkh2Avdt5xDX84Chzf0RYMu61msNV+vQiOrV++fvNwHAdzWCuo1CbDhwhhhbKhjQxGR3DOhNjxnPHlZJ+Ss5m3F6G3oBAMDTEZYyLJ+Grer51lADmkohYX/rlJDBUJ9t+AyArJiCbgrzxrRlMXjk7Wx7zTHgDrgbSjR6Bz7lg9SA=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmtfOBc0mEwrvWSxI1JAl5RGiVDMm1IJXUkkUis6Tr3l85S2p2tyvYm0f/IsXnkXwQVnn6Z07FOuMfz1X4fnc5ktu1OIRvl6ah9m9iBAjQhyIMtu1nkqV6/bQb90L8GB6nQ/Yu3AQPg+yJ2pQsZBHSxTcKwnqiqJSku35J7fWz0QUgK39mx3i7x+Lp6lxLAs3fJy0Nw/ZtIA0Mc1AOp0JyBFdGSMyClX+4u6R53ubGjI75R8gBC1T+P01lSQqnBWw1Q+YOVH8R47zYAjcSy5EAEMgexD/NQAfUGMx3Q5B4CeVVroVt3dOlt0K6RjX3xcLYuf6zvuL4zNLN5QRYnTpwwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
// 地址加站点
	public static String notify_url = "http://localhost:8005/005-money-web/loan/page/payBack";
//	public static String notify_url = "http://192.168.230.128:8005/005-money-web/loan/page/payBack";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
// 地址加站点
	public static String return_url = "http://localhost:8005/005-money-web/loan/page/payBack";
//	public static String return_url = "http://192.168.230.128:8005/005-money-web/loan/page/payBack";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
// 用沙箱时记得改这个地址
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}